package com.example.app.Entity;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;

import java.util.List;

@Dao
public interface PostDao {
    @Insert
    void insert(Post post);
    
    @Query("SELECT * FROM posts WHERE author_id = :authorId")
    List<Post> getPostsByUserId(Long authorId);
    
    @Query("SELECT * FROM posts WHERE id = :postId")
    Post getPostById(Long postId);
}